package com.chinatsp.onlineapp.ui.limit_rule;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.chinatsp.onlineapp.R;
import com.chinatsp.onlineapp.base.BaseActivity;
import com.chinatsp.onlineapp.presenter.LimitNumDao;
import com.chinatsp.onlineapp.ui.violation.SelectCityActivity;
import com.chinatsp.onlineapp.utils.ActivityUtil;

public class LimitNumActivity extends BaseActivity implements View.OnClickListener{

    private Button btnLimitRule;
    private ImageView ivBack;
    private Button btnCity;
    private LimitNumDao mLimitNumDao;

    @Override
	public void onRequestSuccess(int requestCode) {
		super.onRequestSuccess(requestCode);
		// 开始更新UI
		showProgress(false);
	}

	@Override
	public void onRequestFailed(String errorNo, String errorMessage) {
		super.onRequestFailed(errorNo, errorMessage);
		// 开始更新UI
		showProgress(false);
	}
	
    @Override
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_limit_num);
        initView();
    }

    private void initView() {
    	mLimitNumDao = new LimitNumDao(this, this);
        ivBack = (ImageView) findViewById(R.id.iv_back);
        btnLimitRule = (Button) findViewById(R.id.btn_limit_rule);
        btnCity = (Button) findViewById(R.id.btn_city);
        
        showProgress(true);
        mLimitNumDao.getLimitNum("北京");
        
        ivBack.setOnClickListener(this);
        btnLimitRule.setOnClickListener(this);
        btnCity.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_limit_rule:
                ActivityUtil.intentActivity(LimitNumActivity.this, LimitRuleActivity.class, null);
                break;
            case R.id.iv_back:
                finish();
                break;
            case R.id.btn_city:
               ActivityUtil.intentActivity(LimitNumActivity.this, SelectCityActivity.class, null);
                break;
        }
    }
}
